Row

Description

This dashboard visualizes the location and magnitude of all the earthquakes that occurred in the past week. The data is sourced from the USGS, which provides real-time GeoJSON feeds of seismic events around the world.

Number of Earthquakes

earthquake_count <- nrow(earthquake[earthquake$type == "earthquake",])
valueBox(earthquake_count, icon = "fa-house-crack")
1730

Number of Explosions

explosion_count <- nrow(earthquake[earthquake$type == "explosion",])
valueBox(explosion_count, icon = "fa-explosion")
5

Number of Quarry Blasts

quarry_blast_count <- nrow(earthquake[earthquake$type == "quarry blast",])
valueBox(quarry_blast_count, icon = "fa-hill-rockslide")
22

Row

Earthquake Map

# schema()

plot_ly() %>%
  add_trace(
    type = "scattermapbox",
    lon = st_coordinates(earthquake)[,1],
    lat = st_coordinates(earthquake)[,2],
    mode = "markers",
    name = str_to_title(earthquake$type),
    marker = list(
      size = earthquake$mag*5,
      sizemin = 1
    ),
    hovertext = paste0("Earthquake Magnitude Scales: ", earthquake$mag, "\n",
                       "Place: ", earthquake$place, "\n",
                       "URL: ", earthquake$url)
  ) %>%
  layout(
    mapbox = list(
      style = "open-street-map",
      zoom = 4,
      center = list(lon = -98.58, lat = 39.82)
    ),
    legend= list(itemsizing = "constant",
                 title = list(text = "Type")
                 )
  ) %>%
  config(
    toImageButtonOptions = list(
      format = "svg", 
      width = NULL, 
      height = NULL
    )
  )

Earthquake Data

datatable(st_drop_geometry(earthquake))